home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1997 August / Walnut Creek CDROM.7z / LISTINGS / V_13_05 / ALLISON / PERSON.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-11  |  646 b   |  30 lines

  1. LISTING 17 - The Person class implementation
  2. // person.cpp
  3. #include <iostream.h>
  4. #include "person.h"
  5.  
  6. Person::Person(const string& l, const string& f,
  7.                const Date& b, const string& s)
  8.     : last(l), first(f), birth(b), ssn(s)
  9. {}
  10.  
  11. ostream& operator<<(ostream& os, const Person& p)
  12. {
  13.     os << '{'
  14.        << p.last << ','
  15.        << p.first << ','
  16.        << '[' << p.birth << ']' << ','
  17.        << p.ssn
  18.        << '}';
  19.     return os;
  20. }
  21.  
  22. bool Person::operator==(const Person & p) const
  23. {
  24.     return last == p.last &&
  25.            first == p.first &&
  26.            birth == p.birth &&
  27.            ssn == p.ssn;
  28. }
  29.  
  30.